﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BLL;

namespace EDM
{
   public class AuthorityRepository:IAuthorityRepository
    {
        public List<BLL.Authority> Search()
        {



            List<BLL.Authority> authorityList = new List<BLL.Authority>();

            TrainingWorkshopEntities db = new TrainingWorkshopEntities();

            List<EDM.Authority> edmAuthorityList = (from m in db.Authorities select m).ToList<Authority>();
           
            foreach (Authority au in edmAuthorityList)
            {
                BLL.Authority bllauthority = new BLL.Authority();
                bllauthority.AuthorityId = au.AuthorityId;
                bllauthority.AuthorityName = au.AuthorityName;

                authorityList.Add(bllauthority);

            }
            return authorityList;
        }
    }
}
